const {defineConfig} = require("@vue/cli-service");
const ElementPlus = require("unplugin-element-plus/webpack");
const path = require("path");//引入path模块
function resolve(dir) {
  return path.join(__dirname, dir);//path.join(__dirname)设置绝对路径
}

module.exports = defineConfig({
  transpileDependencies: true,
  configureWebpack: { // 配置webpack
    resolve: {
      extensions: [".js", ".vue", ".json"],
      alias: {
        "@": resolve("src")
      }
    }
  },
  devServer: {
    proxy: {
      "/api": {
        target: "https://www.fastmock.site/mock/8562d36892f278b39d96e2512e5ac127/api",
        ws: true,
        changeOrigin: true,
        pathRewrite: {
          "^/api": ""
        }
      }
    }
  }
});
